<script setup>
import {ref,onMounted} from 'vue'
import Xgplayer from 'xgplayer'


const playerRef = ref(null);

onMounted(()=>{
    playerRef.value = new Xgplayer({
        id: 'player',
        url: 'http://localhost:9000/xingnetstudy/171109145328612.mp4', // 视频流地址
        fluid: true,
        fitVideoSize: 'fixWidth',
        playbackRate: [0.5, 0.75, 1, 1.5, 2] //传入倍速可选数组
      });
})
// 暴露
defineExpose({
  playerRef
})
</script>
<template>
    <div id="player"></div>
</template>
<style scoped>
#player{
  width:100%;
  height: 100%;
}
</style>